home *** CD-ROM | disk | FTP | other *** search
- Path: news.win.tue.nl!!jann
- From: jann@ (Jan Cornelis Nieuwenhuizen)
- Newsgroups: comp.lang.c++
- Subject: nested class forward declaration
- Date: 8 Mar 1996 12:44:08 GMT
- Organization: Eindhoven University of Technology, The Netherlands
- Message-ID: <4hpa2o$55s@svin09.win.tue.nl>
- NNTP-Posting-Host: pcnov095.win.tue.nl
-
- a new language feature allows forward declaration of a nested class:
-
- class Enclose
- {
- class Inner; // forward declaration Enclose::Inner
- Inner* use_as_pointer;
- };
-
- class Enclose::Inner
- {
-
- };
-
- but now i can only use ptr or ref members, and have to (manually) invoke
- "new" in all Enclose constructors (and delete in destructors).
-
- i-d like to fully declare the Inner class *before* the Enclosing class,
- something like:
-
- class Enlcose::Inner // need to declare before using as member.
- {
- };
-
- class Enclose
- {
- Inner use_as_member;
- };
-
-